package com.m3958.firstgwt.client.place;

import com.m3958.firstgwt.client.MyPlace;
import com.m3958.firstgwt.client.types.ViewNameEnum;

public class MenuItemEditPlace extends MyPlace{

	private String menuItemId;
	
	private String menuLevelId;

	public MenuItemEditPlace(String menuLevelAndItemId){
		String[] ss = menuLevelAndItemId.split(",");
		this.setMenuLevelId(ss[0]);
		if(ss.length > 1)this.menuItemId = ss[1];
	}
	
	public MenuItemEditPlace(String menuLevelId,String menuItemId){
		this.menuLevelId = menuLevelId;
		this.menuItemId = menuItemId;
	}
	
	@Override
	public String getToken() {
		return ViewNameEnum.MENUITEM_EDIT.toString().toLowerCase() + "/" + menuLevelId + "," + menuItemId;
	}

	public String getMenuItemId() {
		return menuItemId;
	}

	public void setMenuItemId(String menuItemId) {
		this.menuItemId = menuItemId;
	}

	public void setMenuLevelId(String menuLevelId) {
		this.menuLevelId = menuLevelId;
	}

	public String getMenuLevelId() {
		return menuLevelId;
	}

}
